package wxappapi

import (
	"github.com/gogf/gf/v2/database/gdb"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/tiger1103/gfast/v3/internal/wxAppApi/model"
)

type WxAppApiRegisterReq struct {
	g.Meta    `path:"/register"  tags:"微信应用用户" method:"post" summary:"用户注册"`
	Username  string `p:"username" v:"required|length:6,30#请输入用户名|用户名长度应在6到30个字符之间"`
	Password  string `p:"password" v:"required|length:6,30#请输入密码|密码长度应在6到30个字符之间"`
	Password2 string `p:"password2" v:"required|length:6,30|same:password#请输入确认密码|确认密码长度应在6到30个字符之间|两次密码输入不一致"`
}

type WxAppApiRegisterRes struct {
	g.Meta `mime:"application/json"`
}

type WxAppApiLoginReq struct {
	g.Meta   `path:"/login"  tags:"微信应用用户" method:"post" summary:"用户登录"`
	Username string `p:"username" v:"required|length:6,30#请输入用户名|用户名长度应在6到30个字符之间"`
	Password string `p:"password" v:"required|length:6,30#请输入密码|密码长度应在6到30个字符之间"`
}

type WxAppApiLoginRes struct {
	Token string `json:"token"`
}

type WxAppApiGetReq struct {
	g.Meta `path:"/get" method:"get" tags:"微信应用用户" summary:"获取用户信息"`
}

type WxAppApiGetRes struct {
	UserInfo gdb.Record `json:"userInfo`
}

type WxAppApiUserEditReq struct {
	g.Meta `path:"/edit" method:"put" tags:"微信应用用户" summary:"编辑用户信息"`
	*model.UserEditReq
}

type WxAppApiUserEditRes struct {
	g.Meta `mime:"application/json"`
}
